package loop;

public class ForForDemo1 {
    public static void main(String[] args) {
        print();
        print99();
    }

    public static void print() {
        for (int i = 0; i < 4; i++) {

            for (int j = 0; j < 5; j++) {

                System.out.print("*");//不换行用print，换行用println
            }

            System.out.println();// 换行
        }
    }

    // 定义一个方法，打印九九乘法表
    public static void print99() {
        //定义循环打印多少行
        for (int i = 1; i <=9 ; i++) {
            //定义循环打印多少列
            for (int j =1 ; j <=i ; j++) {
                //打印乘法表
                System.out.print(j + " x " + i + " = " + (i * j) + "\t");// \t是制表符
            }
            //换行
            System.out.println();
        }
    }
}
